#include<bits/stdc++.h>
using namespace std;

const int N=1e5+5;

int n,ans,tot,flag=2;
int a[N],h1[N],h2[N],h[N];

inline int read(){
    int f=1,k=0;
    char c=getchar();
    while(c<'0'||c>'9'){
        if(c=='-') f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        k=k*10+c-'0';
        c=getchar();
    }
    return f*k;
}

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    ans=n;
    for(int i=1;i<=n;i++){
        a[i]=read();
        h[a[i]]++;
    }
    for(int i=1;i<=1e5;i++){
        if(h[i]){
            tot++;
            h1[tot]=h[i];
            h2[tot]=h[i];
        }
    }
    for(int i=1;i<tot;i++){
        for(int j=max(i+1,flag);j<=tot;j++){
            if(h1[j]<h2[i]){
                h2[i]-=h1[j];
                ans-=h1[j];
                h1[j]=0;
                flag=j+1;
            }
            if(h1[j]>=h2[i]){
                h1[j]-=h2[i];
                ans-=h2[i];
                flag=j;
                break;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}
